package com.kfgj.hkp.common.journal.entity;


import com.kfgj.hkp.common.dic.DictionaryStorage;
import com.kfgj.hkp.common.enums.ClientType;
import com.kfgj.hkp.common.enums.OperationType;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * @version 1.0
 * @description TODO
 * @auth liwensihan
 * @date 2018/8/14 15:08
 */
@Data
public class OperationLog implements Serializable {

    //如下字段是需要的，继承父类
    //cpyCode、cpyName
    //createCode、createName、createDeptCode、createDeptName、
    //createTime、remark

//    private String _id;

    /**
     * id
     */
    private String id;

    /**
     * SAAS模式下的公司或者团队编码
     */
    private String cpyCode;

    /**
     * SAAS模式下公司或者团队名称
     */
    private String cpyName;

    /**
     * 创建者
     */
    private String createCode;

    /**
     * 创建者名称
     */
    private String createName;

    /**
     * 创建者编号
     */
    private String createDeptCode;

    /**
     * 创建者部门名称
     */
    private String createDeptName;

    /**
     * 最后更新者
     */
    private String lastUpdateCode;
    /**
     * 最后更新者名称
     */
    private String lastUpdateName;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 最后更新时间
     */
    private Date lastUpdateTime;

    /**
     * 备注描述
     */
    private String remark;

    /**
     * 操作编码
     */
    private String oprCode;
    /**
     * @see OperationType
     */
    private String oprType;

    /**
     * 操作类型名称
     */
    private String oprTypeName;
    //请求的URL
    private String url;
    /**
     * 存放制定模块的名称，自定义的
     */
    private String module;
    //业务请求编码，比如查询某个用户的时候，此处存放用户编码
    private String businessCode;
    /**
     * 操作请求来源
     * @see ClientType
     */
    private String clientType;
    /**
     * 客户端来源名称
     */
    private String clientTypeName;
    //请求来源IP地址
    private String ip;
    //请求的内容
    private String request;
    //响应数据
    private String response;


//    public String get_id() {
//        return _id;
//    }
//
//    public void set_id(String _id) {
//        this._id = _id;
//    }


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getCpyCode() {
        return cpyCode;
    }

    public void setCpyCode(String cpyCode) {
        this.cpyCode = cpyCode;
    }

    public String getCpyName() {
        return cpyName;
    }

    public void setCpyName(String cpyName) {
        this.cpyName = cpyName;
    }

    public String getCreateCode() {
        return createCode;
    }

    public void setCreateCode(String createCode) {
        this.createCode = createCode;
    }

    public String getCreateName() {
        return createName;
    }

    public void setCreateName(String createName) {
        this.createName = createName;
    }

    public String getCreateDeptCode() {
        return createDeptCode;
    }

    public void setCreateDeptCode(String createDeptCode) {
        this.createDeptCode = createDeptCode;
    }

    public String getCreateDeptName() {
        return createDeptName;
    }

    public void setCreateDeptName(String createDeptName) {
        this.createDeptName = createDeptName;
    }

    public String getLastUpdateCode() {
        return lastUpdateCode;
    }

    public void setLastUpdateCode(String lastUpdateCode) {
        this.lastUpdateCode = lastUpdateCode;
    }

    public String getLastUpdateName() {
        return lastUpdateName;
    }

    public void setLastUpdateName(String lastUpdateName) {
        this.lastUpdateName = lastUpdateName;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getLastUpdateTime() {
        return lastUpdateTime;
    }

    public void setLastUpdateTime(Date lastUpdateTime) {
        this.lastUpdateTime = lastUpdateTime;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getOprTypeName() {
        return DictionaryStorage.get(ClientType.getClientTypeKey(),this.getOprType()).getName();
    }

    public void setOprTypeName(String oprTypeName) {
        this.oprTypeName = oprTypeName;
    }

    public String getClientTypeName() {
        return DictionaryStorage.get(ClientType.getClientTypeKey(),this.getClientType()).getName();
    }

    public void setClientTypeName(String clientTypeName) {
        this.clientTypeName = clientTypeName;
    }

    public String getOprCode() {
        return oprCode;
    }

    public void setOprCode(String oprCode) {
        this.oprCode = oprCode;
    }

    public String getOprType() {
        return oprType;
    }

    public void setOprType(String oprType) {
        this.oprType = oprType;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getModule() {
        return module;
    }

    public void setModule(String module) {
        this.module = module;
    }

    public String getBusinessCode() {
        return businessCode;
    }

    public void setBusinessCode(String businessCode) {
        this.businessCode = businessCode;
    }

    public String getClientType() {
        return clientType;
    }

    public void setClientType(String clientType) {
        this.clientType = clientType;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getRequest() {
        return request;
    }

    public void setRequest(String request) {
        this.request = request;
    }

    public String getResponse() {
        return response;
    }

    public void setResponse(String response) {
        this.response = response;
    }
}
